package com.five.api.controller;

import com.five.controller.BaseController;
import com.five.api.service.CourseClassifyService;
import com.five.entity.CourseClassify;
import com.five.vo.BaseResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author: star
 * @Date: 2021-05-21 14:13
 *  课程分类 Controller层
 */
@Controller
@RequestMapping("courseClassify")
@CrossOrigin
@Api("课程分类业务接口")
public class CourseClassifyController extends BaseController {

    @Autowired
    private CourseClassifyService courseClassifyService;

    @ResponseBody
    @RequestMapping(value = "query",method = RequestMethod.POST)
    @ApiOperation("获取课程分类接口")
    public BaseResultVO<List<CourseClassify>> query(){

        List<CourseClassify> courseClassifies = courseClassifyService.query();

        return successResp(courseClassifies);
    }

}
